package com.scommunity.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.sql.Time;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;

/**
 * 车辆表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "sc_car")
public class Car implements Serializable{
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.INPUT)
    private Long carId;
    private Long ownerId;
    private String carNum;
    private String carType;
    private String carBrand;
    private String carStatus;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String inTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String outTime;
    
    public Car(Car car) {
        if (Objects.nonNull(car)) {
            this.carId=car.carId;
            this.ownerId=car.ownerId;
            this.carNum=car.carNum;
            this.carType=car.carType;
            this.carBrand=car.carBrand;
            this.carStatus=car.carStatus;
            this.inTime=car.inTime;
            this.outTime=car.outTime;
        }
    }
}
